
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/12_Table_A8.do" 

. /****************************************************************************
> *****************************
> Replication Files for Housing Discrimination and the Toxics Exposure Gap in t
> he United States: 
> Evidence from the Rental Market  by Peter Christensen, Ignacio Sarmiento-Barb
> ieri and Christopher Timmins
> *****************************************************************************
> ****************************/
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. keep if sample==1
(801 observations deleted)

. 
. loc quartiles 4

. 
. set seed 1010101

. *****************************************************************************
> *******************
. * Prep data
. *****************************************************************************
> *******************
. drop if times_zip==.
(3,321 observations deleted)

. drop if times_zip==3
(306 observations deleted)

. keep if sample_two_inquiries>3
(1,524 observations deleted)

. 
. 
. gen first=(times_zip==1)

. gen second=(times_zip==2)

. 
. 
. foreach depvar in first second {
  2.         gen Hispanic_`depvar'=Hispanic*`depvar'
  3.         gen Black_`depvar'=Black*`depvar'
  4.         gen Minority_`depvar'=Minority*`depvar'
  5. 
. }

. 
. 
. 
. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
.  
. 
. 
. eststo: disc_boot choice Minority_first Minority_second , varlist(i.gender i.
> education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 323 groups (969 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -201.73334  
Iteration 1:   log pseudolikelihood = -199.04317  
Iteration 2:   log pseudolikelihood = -199.04026  
Iteration 3:   log pseudolikelihood = -199.04026  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =        603
                                                Wald chi2(3)      =          .
                                                Prob > chi2       =          .
Log pseudolikelihood = -199.04026               Pseudo R2         =     0.0986

                               (Std. Err. adjusted for 4 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_f~t |  -.5438845   .2653338    -2.05   0.040    -.9803197   -.1074493
Minority_s~d |  -.9664195   .1247717    -7.75   0.000    -1.171651   -.7611883
             |
      gender |
       male  |  -.2696856   .2933863    -0.92   0.358    -.7522631    .2128919
             |
education_~l |
        low  |  -.4336666   .1534768    -2.83   0.005    -.6861135   -.1812197
     medium  |  -1.002016   .3893986    -2.57   0.010    -1.642519   -.3615119
             |
       order |
          2  |  -.2811747   .1634832    -1.72   0.085    -.5500807   -.0122688
          3  |   -.319474   .1580892    -2.02   0.043    -.5795075   -.0594404
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_f~t |  -.5438845   .2738688    -1.99   0.141    -1.188397    .1006284
Minority_s~d |  -.9664195   .1073132    -9.01   0.003    -1.218966   -.7138725
------------------------------------------------------------------------------
(est1 stored)

. sum choice if White==1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        524    .4541985    .4983736          0          1

. estadd scalar responsewhite = r(mean), replace 

added scalar:
      e(responsewhite) =  .45419847

. estadd local gender = "Yes", replace 

added macro:
             e(gender) : "Yes"

. estadd local edu = "Yes", replace 

added macro:
                e(edu) : "Yes"

. estadd local order = "Yes", replace 

added macro:
              e(order) : "Yes"

. estimates store model1

. 
. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. eststo: disc_boot choice Black_first Black_second  Hispanic_first Hispanic_se
> cond , varlist(i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 323 groups (969 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -195.37794  
Iteration 1:   log pseudolikelihood = -191.53799  
Iteration 2:   log pseudolikelihood =  -191.5297  
Iteration 3:   log pseudolikelihood =  -191.5297  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =        603
                                                Wald chi2(3)      =          .
                                                Prob > chi2       =          .
Log pseudolikelihood =  -191.5297               Pseudo R2         =     0.1326

                               (Std. Err. adjusted for 4 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
 Black_first |  -.9034178   .3262053    -2.77   0.006    -1.439978   -.3668578
Black_second |  -1.300792   .1732633    -7.51   0.000    -1.585785   -1.015799
Hispanic_f~t |  -.1523907   .3202316    -0.48   0.634    -.6791248    .3743434
Hispanic_s~d |  -.6677126   .1253818    -5.33   0.000    -.8739473   -.4614779
             |
      gender |
       male  |  -.2591688   .2767195    -0.94   0.349    -.7143318    .1959942
             |
education_~l |
        low  |  -.3702767   .1418089    -2.61   0.009    -.6035316   -.1370218
     medium  |   -.972451   .3738054    -2.60   0.009    -1.587306   -.3575957
             |
       order |
          2  |   -.253399   .1401064    -1.81   0.071    -.4838536   -.0229444
          3  |  -.3070896   .1902798    -1.61   0.107     -.620072    .0058929
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codeclus
> ter(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
 Black_first |  -.9034178   .2982394    -3.03   0.056    -1.605284   -.2015521
Black_second |  -1.300792   .1796943    -7.24   0.005    -1.723678    -.877906
Hispanic_f~t |  -.1523907   .3360605    -0.45   0.681    -.9432632    .6384818
Hispanic_s~d |  -.6677126   .1065383    -6.27   0.008    -.9184359   -.4169893
------------------------------------------------------------------------------
(est2 stored)

. sum choice if White==1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        524    .4541985    .4983736          0          1

. estadd scalar responsewhite = r(mean), replace 

added scalar:
      e(responsewhite) =  .45419847

. estadd local gender = "Yes", replace 

added macro:
             e(gender) : "Yes"

. estadd local edu = "Yes", replace 

added macro:
                e(edu) : "Yes"

. estadd local order = "Yes", replace 

added macro:
              e(order) : "Yes"

. estimates store model2

. 
. 
. 
. *****************************************************************************
> *******************
. * Export to latex
. * based on http://www.eyalfrank.com/code-riffs-stata-and-regression-tables/
. *****************************************************************************
> *******************
. 
. 
. #delimit ; 
delimiter now ;
. esttab model1
>           model2
>        using "../views/tableA8.tex",  
>        style(tex) 
>        eform
>        cells(b(star fmt(4)) ci(par fmt(4) par(( , )))  ) 
>        label 
>        stats(responsewhite
>              gender 
>              edu 
>              order
>              N
>              listings
>              diff_response, fmt(2 0 0 0 %9.0gc %9.0gc 2)
>              labels(" Mean Response (White)"
>                    "\hline Gender" 
>                    "Education Level" 
>                    "Inquiry Order"
>                    "\hline Observations"
>                    "Listings"
>                    "\% w. diff. response"
>                    )) 
>        mlabels( ,none)  
>        nonumbers
>        collabels(,none) 
>        eqlabels(,none)
>        varlabels(Minority_first  "Minority First Inquiry"
>                 Minority_second "Minority Second Inquiry"
>                 Black_first  "African American First Inquiry"
>                 Black_second "African American Second Inquiry"
>                 Hispanic_first "Hispanic/LatinX First Inquiry"
>                 Hispanic_second "Hispanic/LatinX Second Inquiry") 
>        starl(* 0.1 ** 0.05 *** 0.01)   
>        level(90) 
>        prehead(
> \begin{table}[H]
> \footnotesize \centering
> \begin{threeparttable}
> \captionsetup{justification=centering}
>   \caption{Overall Discrimination Rates \\
>   Properties with Two Inquiries}
>   \label{tab:probhighexposuretwoinquiries}
> 
> \begin{tabular}{@{\extracolsep{5pt}} lcc} 
> \\[-1.8ex]\hline 
> \hline \\[-1.8ex] 
> & \multicolumn{2}{c}{\it Dependent variable:} \\
> & \multicolumn{2}{c}{\it  Response} \\
> \cline{2-3}\\ [-1.8ex]
> 
> &(1)              & (2)                   \\
>        )
>        posthead(\hline) 
>        prefoot() 
>        postfoot(
> \\[-1.8ex]\hline 
> \hline \\[-1.8ex] 
> \end{tabular} 
> \begin{tablenotes}[scriptsize,flushleft] \scriptsize
> \item Notes: 
> \end{tablenotes}
> \end{threeparttable}
> \end{table}
>        )
>        replace;
(output written to ../views/tableA8.tex)

. #delimit cr
delimiter now cr
. 
. 
. 
. 
. *end
. 
end of do-file
